<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>店铺申请详情 - 巷陌发现</title>
  <link rel="stylesheet" href="../static/bootstrap-icons/font/bootstrap-icons.css">
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
      background-color: #f5f7fa;
      color: #333;
      line-height: 1.6;
      padding: 20px;
    }

    .container {
      max-width: 1000px;
      margin: 0 auto;
    }

    .page-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 30px;
      padding-bottom: 15px;
      border-bottom: 1px solid #eaeaea;
    }

    .page-title {
      font-size: 28px;
      font-weight: 600;
      color: #333;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .page-title i {
      color: #6a11cb;
    }

    .back-btn {
      background-color: #6c757d;
      color: white;
      border: none;
      padding: 10px 20px;
      border-radius: 6px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: background-color 0.3s;
      font-size: 14px;
    }

    .back-btn:hover {
      background-color: #5a6268;
    }

    .card {
      background-color: white;
      border-radius: 8px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
      margin-bottom: 20px;
      overflow: hidden;
    }

    .card-header {
      padding: 20px;
      background-color: #f8f9fa;
      border-bottom: 1px solid #eaeaea;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .card-title {
      font-size: 20px;
      font-weight: 600;
      color: #333;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .status-badge {
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 14px;
      font-weight: 500;
    }

    .status-pending {
      background-color: #fff3cd;
      color: #856404;
    }

    .status-approved {
      background-color: #d1edff;
      color: #0c5460;
    }

    .status-rejected {
      background-color: #f8d7da;
      color: #721c24;
    }

    .card-body {
      padding: 25px;
    }

    .section-title {
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 20px;
      color: #333;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .section-title i {
      color: #6a11cb;
      background: rgba(106, 17, 203, 0.1);
      width: 36px;
      height: 36px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
    }

    .info-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 20px;
    }

    .info-item {
      margin-bottom: 15px;
    }

    .info-label {
      display: block;
      margin-bottom: 5px;
      font-weight: 500;
      color: #666;
      font-size: 14px;
    }

    .info-value {
      font-size: 16px;
      color: #333;
      padding: 8px 0;
    }

    .info-value.empty {
      color: #999;
      font-style: italic;
    }

    .shop-avatar-section {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-bottom: 20px;
    }

    .shop-avatar-large {
      width: 150px;
      height: 150px;
      border-radius: 12px;
      overflow: hidden;
      margin-bottom: 10px;
      border: 4px solid #f0f4f8;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .shop-avatar-large img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .images-section {
      margin-top: 20px;
    }

    .images-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 15px;
      margin-top: 15px;
    }

    .image-item {
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      aspect-ratio: 1;
    }

    .image-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.3s;
    }

    .image-item:hover img {
      transform: scale(1.05);
    }

    /* 文件预览区域样式 */
    .documents-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 20px;
      margin-top: 15px;
    }

    .document-item {
      border: 1px solid #eaeaea;
      border-radius: 8px;
      padding: 15px;
      background-color: #f8f9fa;
      transition: all 0.3s;
    }

    .document-item:hover {
      border-color: #6a11cb;
      box-shadow: 0 4px 12px rgba(106, 17, 203, 0.1);
    }

    .document-preview {
      width: 100%;
      height: 200px;
      border-radius: 6px;
      overflow: hidden;
      margin-bottom: 10px;
      background-color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #eaeaea;
    }

    .document-preview img {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
    }

    .document-preview .file-icon {
      font-size: 48px;
      color: #6c757d;
    }

    .document-preview .pdf-icon {
      color: #dc3545;
    }

    .document-preview .word-icon {
      color: #2b579a;
    }

    .document-actions {
      display: flex;
      gap: 10px;
    }

    .document-btn {
      flex: 1;
      padding: 8px 12px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      transition: all 0.3s;
    }

    .document-btn.preview {
      background-color: #6a11cb;
      color: white;
    }

    .document-btn.preview:hover {
      background-color: #5a0dc8;
    }

    .document-btn.download {
      background-color: #28a745;
      color: white;
    }

    .document-btn.download:hover {
      background-color: #218838;
    }

    .audit-info {
      background-color: #f8f9fa;
      border-radius: 8px;
      padding: 20px;
      margin-top: 20px;
    }

    .audit-info .info-grid {
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .action-buttons {
      display: flex;
      gap: 15px;
      justify-content: flex-end;
      margin-top: 30px;
      padding-top: 20px;
      border-top: 1px solid #eaeaea;
    }

    .btn {
      padding: 12px 24px;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-size: 16px;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: all 0.3s;
    }

    .btn-primary {
      background-color: #6a11cb;
      color: white;
    }

    .btn-primary:hover {
      background-color: #5a0dc8;
    }

    .btn-secondary {
      background-color: #6c757d;
      color: white;
    }

    .btn-secondary:hover {
      background-color: #5a6268;
    }

    .btn-success {
      background-color: #28a745;
      color: white;
    }

    .btn-success:hover {
      background-color: #218838;
    }

    .btn-danger {
      background-color: #dc3545;
      color: white;
    }

    .btn-danger:hover {
      background-color: #c82333;
    }

    /* 模态框样式 */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.8);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
      padding: 20px;
    }

    .modal-content {
      background-color: white;
      border-radius: 8px;
      width: 90%;
      max-width: 900px;
      max-height: 90vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .modal-header {
      padding: 20px;
      border-bottom: 1px solid #eaeaea;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .modal-title {
      font-size: 20px;
      font-weight: 600;
    }

    .modal-close {
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: #666;
    }

    .modal-body {
      flex: 1;
      padding: 0;
      overflow: auto;
    }

    .pdf-viewer, .doc-viewer {
      width: 100%;
      height: 70vh;
      border: none;
    }

    .image-viewer {
      width: 100%;
      max-height: 70vh;
      object-fit: contain;
    }

    @media (max-width: 768px) {
      .info-grid {
        grid-template-columns: 1fr;
      }

      .documents-grid {
        grid-template-columns: 1fr;
      }

      .action-buttons {
        flex-direction: column;
      }

      .btn {
        width: 100%;
        justify-content: center;
      }

      .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      }

      .modal-content {
        width: 95%;
      }
    }
  </style>
</head>
<body>
<div class="container">
  <div class="page-header">
    <h1 class="page-title">
      <i class="bi bi-shop"></i> 店铺申请详情
    </h1>
    <button class="back-btn" onclick="window.history.back()">
      <i class="bi bi-arrow-left"></i> 返回
    </button>
  </div>

  <!-- 店铺基本信息卡片 -->
  <div class="card">
    <div class="card-header">
      <h2 class="card-title">
        <i class="bi bi-info-circle"></i> 基本信息
      </h2>
      <div id="statusBadge" class="status-badge status-pending">待审核</div>
    </div>
    <div class="card-body">
      <div class="shop-avatar-section">
        <div class="shop-avatar-large">
          <img id="shopAvatar" src="" alt="店铺头像">
        </div>
      </div>

      <div class="info-grid">
        <div class="info-item">
          <span class="info-label">店铺名称</span>
          <div class="info-value" id="shopName">-</div>
        </div>

        <div class="info-item">
          <span class="info-label">店铺描述</span>
          <div class="info-value" id="shopDesc">-</div>
        </div>

        <div class="info-item">
          <span class="info-label">店主ID</span>
          <div class="info-value" id="ownerId">-</div>
        </div>

        <div class="info-item">
          <span class="info-label">营业时间</span>
          <div class="info-value" id="businessHours">-</div>
        </div>

        <div class="info-item">
          <span class="info-label">地理位置</span>
          <div class="info-value" id="location">-</div>
        </div>

        <div class="info-item">
          <span class="info-label">申请时间</span>
          <div class="info-value" id="createdTime">-</div>
        </div>
      </div>

      <div class="images-section">
        <h3 class="section-title">
          <i class="bi bi-images"></i> 店铺图片
        </h3>
        <div class="images-grid" id="shopImages"></div>
      </div>
    </div>
  </div>

  <!-- 资质证明卡片 -->
  <div class="card">
    <div class="card-header">
      <h2 class="card-title">
        <i class="bi bi-file-earmark-check"></i> 资质证明
      </h2>
    </div>
    <div class="card-body">
      <div class="section-title">
        <i class="bi bi-file-earmark-pdf"></i> 营业执照
      </div>
      <div class="documents-grid" id="businessLicenseDocs"></div>

      <div class="section-title" style="margin-top: 30px;">
        <i class="bi bi-file-earmark-word"></i> 验证材料
      </div>
      <div class="documents-grid" id="verifyDocs"></div>

      <div class="section-title" style="margin-top: 30px;">
        <i class="bi bi-files"></i> 其他证明材料
      </div>
      <div class="documents-grid" id="otherDocs"></div>
    </div>
  </div>

  <!-- 审核信息卡片 -->
  <div class="card">
    <div class="card-header">
      <h2 class="card-title">
        <i class="bi bi-clipboard-check"></i> 审核信息
      </h2>
    </div>
    <div class="card-body">
      <div class="audit-info">
        <div class="info-grid">
          <div class="info-item">
            <span class="info-label">审核人</span>
            <div class="info-value" id="auditPerson">-</div>
          </div>

          <div class="info-item">
            <span class="info-label">审核时间</span>
            <div class="info-value" id="auditTime">-</div>
          </div>

          <div class="info-item">
            <span class="info-label">审核说明</span>
            <div class="info-value" id="auditDesc">-</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- 文件预览模态框 -->
<div class="modal-overlay" id="fileModal" style="display: none;">
  <div class="modal-content">
    <div class="modal-header">
      <h3 class="modal-title" id="fileModalTitle">文件预览</h3>
      <button class="modal-close" onclick="closeFileModal()">&times;</button>
    </div>
    <div class="modal-body" id="fileModalBody">
      <!-- 文件预览内容将动态插入 -->
    </div>
  </div>
</div>
<script src="../static/js/jquery.js"></script>
<script src="../static/js/jquery.cookie.js"></script>
<script src="../static/js/ShopAduitEdit.js"></script>
</body>
</html>